package com.cloud.controller;

import com.cloud.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloud.service.DriverService;

@Controller
@RequestMapping("/driver")
public class DriverController {
	
	@Autowired
	private DriverService driverService;
	
	@GetMapping("/list")
	public String driverList(Integer page,ModelMap mode){
		driverService.getDriverList(page,mode);
		return "driver";
	}
	
	@ResponseBody
	@PostMapping("/set")
	public R setting(String gjnum, String ipnum) {
		driverService.set(gjnum,ipnum);
		return new R(0,"设置成功",null);
	}
	
	@ResponseBody
	@GetMapping("/note")
	public R note(String note) {
		driverService.note(note);
		return new R(0,"设置成功",null);
	}
}
